120 II = I +39: FOR J = I TO II:A = PEEK(J):A = A +(A <32) *192:A = A +(A <64) *128:A = A +(A <96) *64:A = A +(A <128) *64:A = A +(A <160) *64: PRINT CHR$(A);: NEXT : PRINT CHR$(13);: RETURN
130 PRINT CHR$(4)"PR#1": PRINT CHR$(9)"80N"
140 FOR I = 1024 TO 1920 STEP 128: GOSUB 120: NEXT
150 FOR I = 1064 TO 1960 STEP 128: GOSUB 120: NEXT
160 FOR I = 1104 TO 2000 STEP 128: GOSUB 120: NEXT
170 PRINT CHR$(4)"PR#0": RETURN
180 REM INIT. VARIABLES
190 D$ = CHR$(4)
200 GOSUB 7010
210 ONERR GOTO 6530
220 DIM ST$(100): REM STOCK NAME
230 DIM B$(100): REM BUY PRICE
240 DIM BN$(100): REM NUMBER BOUGHT
250 DIM BC$(100): REM BUY COMMISSION
260 DIM SN$(100): REM NUMBER SOLD
270 DIM S$(100): REM SELL PRICE
280 DIM DB$(100): REM DATE BOUGHT
290 DIM DS$(100): REM DATE SOLD
300 DIM SC$(100): REM SELL COMMISSION
310 DIM C%(20)
320 GOSUB 5090
330 TEXT : HOME : VTAB 8: INVERSE :X$ = "LOADING DATAFILE:": GOSUB 4890:X$ = FL$: PRINT : GOSUB 4890: NORMAL
500 TEXT : HOME :X$ = "* THE NIBBLE BROKER *": INVERSE : GOSUB 4890: NORMAL : PRINT : PRINT
510 HTAB 6: PRINT "1) ADD A STOCK": HTAB 6: PRINT "2) LIST A STOCK": HTAB 6: PRINT "3) SELECT STOCK/IRA DATA FILE": HTAB 6: PRINT "4) EDIT/DELETE STOCK INFORMATION": HTAB 6: PRINT "5) LIST ALL STOCKS"
520 HTAB 6: PRINT "6) SEARCH STOCKS BY DATE/NAME": HTAB 6: PRINT "7) STATISTICS": HTAB 6: PRINT "8) EXIT WITHOUT SAVING CHANGES": HTAB 6: PRINT "9) NORMAL PROGRAM EXIT"
530 HTAB 1: VTAB 15: PRINT "ENTER YOUR SELECTION ";: GET G$: POKE -16368,0:M1 = VAL(G$)
540 IF M1 <1 OR M1 >9 THEN VTAB 15: GOTO 530
550 ON M1 GOSUB 640,1320,1610,1690,3080,3360,5310,4130,2610
560 TEXT : GOTO 500
570 REM
580 REM ***************
590 REM * *
600 REM * ADD STOCK *
610 REM * *
620 REM ***************
630 REM
640 HOME :X$ = "ADD STOCK RECORD": INVERSE : GOSUB 4890: NORMAL
650 GOSUB 1230
660 INPUT "ENTER STOCK NAME ";ST1$
670 IF ST1$ = "" THEN VTAB PEEK(37): HTAB 1: GOTO 660
680 IF ST1$ = "R" THEN RETURN
690 FOR I = 1 TO E
700 IF LEFT$(ST1$, LEN(ST1$)) = LEFT$(ST$(I), LEN(ST1$)) THEN 720
710 NEXT I: GOTO 740
720 PRINT : PRINT "DUPLICATE STOCK"
730 PRINT "HIT ANY KEY TO CONTINUE ";: GET G$: RETURN
740 INPUT "ENTER COST PER SHARE: $";B1$: IF B1$ = "" THEN VTAB PEEK(37): HTAB 1: GOTO 740
750 IF B1$ = "R" THEN RETURN
760 IF VAL(B1$) < = 0 THEN PRINT CHR$(13): VTAB ( PEEK(37) -2): CALL -958: GOTO 740
770 INPUT "ENTER # OF SHARES BOUGHT: ";BN1$: IF BN1$ = "" THEN VTAB PEEK(37): HTAB 1: GOTO 770
780 IF BN1$ = "R" THEN RETURN
790 IF VAL(BN1$) = 0 THEN PRINT CHR$(13): VTAB ( PEEK(37) -2): CALL -958: GOTO 770
800 INPUT "ENTER BUYING COMMISSION: $";BC1$: IF BC1$ = "" THEN VTAB PEEK(37): HTAB 1: GOTO 800
810 IF BC1$ = "R" THEN RETURN
820 IF LEFT$(BC1$,1) = "0" THEN 840
830 IF VAL(BC1$) = 0 THEN PRINT CHR$(13): VTAB ( PEEK(37) -2): CALL -958: GOTO 800
840 INPUT "DATE PURCHASED (MM/DD/YY): ";DB1$: IF DB1$ = "" THEN VTAB PEEK(37): HTAB 1: GOTO 840
850 IF DB1$ = "R" THEN RETURN
860 IF LEN(DB1$) < >8 THEN 840
870 IF MID$ (DB1$,3,1) = "/" AND MID$ (DB1$,6,1) = "/" THEN 890
880 GOTO 840
890 PRINT "DATE SOLD (MM/DD/YY): ":CV = PEEK(37): VTAB 22: INVERSE : PRINT " ENTER '00/00/00' IF UNSOLD ": NORMAL : VTAB CV: HTAB 23: INPUT "";DS1$: CALL -958: IF DS1$ = "" THEN VTAB CV: HTAB 1: GOTO 890
900 IF DS1$ = DB1$ THEN 990
910 IF DS1$ = "00/00/00" THEN SC1$ = "0.00":SN1$ = "0":S1$ = "0.00": PRINT : PRINT : PRINT "NO FURTHER ENTRIES REQUIRED": FOR K = 1 TO 500: NEXT : GOTO 1120
920 IF DS1$ = "R" THEN RETURN
930 IF LEN(DS1$) < >8 THEN 890
940 IF MID$ (DS1$,3,1) < >"/" AND MID$ (DS1$,6,1) < >"/" THEN 890
950 IF VAL( RIGHT$(DS1$,2)) < VAL( RIGHT$(DB1$,2)) THEN 890
960 IF VAL( RIGHT$(DS1$,2)) > VAL( RIGHT$(DB1$,2)) THEN 990
970 IF VAL( LEFT$(DS1$,2)) < VAL( LEFT$(DB1$,2)) THEN 890
980 IF VAL( LEFT$(DS1$,2)) = VAL( LEFT$(DB1$,2)) AND VAL( MID$ (DS1$,4,2)) < VAL( MID$ (DB1$,4,2)) THEN 890
990 PRINT "ENTER SELLING COMMISSION: $":CV = PEEK(37): VTAB 22: FLASH : PRINT " ENTER '0.00' IF UNSOLD ": NORMAL : VTAB CV: HTAB 28: INPUT "";SC1$: CALL -958: IF SC1$ = "" THEN VTAB CV: HTAB 1: GOTO 990
1000 IF SC1$ = "R" THEN RETURN
1010 IF LEFT$(SC1$,1) = "0" THEN 1030
1020 IF VAL(SC1$) = 0 THEN PRINT CHR$(13): VTAB ( PEEK(37) -2): CALL -958: GOTO 990
1030 INPUT "ENTER # OF SHARES SOLD: ";SN1$: IF SN1$ = "" THEN VTAB PEEK(37): HTAB 1: GOTO 1030
1040 IF SN1$ = "R" THEN RETURN
1050 IF VAL(SN1$) > VAL(BN1$) THEN CALL 65338: VTAB PEEK(37): HTAB 25: FLASH : PRINT "TOO MANY";: NORMAL : FOR J = 1 TO 1000: NEXT J: HTAB 25: PRINT " ";: HTAB 1: GOTO 1030
1060 IF LEFT$(SN1$,1) = "0" THEN 1080
1070 IF VAL(SN1$) = 0 THEN PRINT CHR$(13): VTAB ( PEEK(37) -2): CALL -958: GOTO 1030
1080 PRINT "SELLING PRICE PER SHARE: $":CV = PEEK(37): VTAB 22: FLASH : PRINT " ENTER '0.00' IF UNSOLD ": NORMAL : VTAB CV: HTAB 27: INPUT "";S1$: CALL -958: IF S1$ = "" THEN VTAB CV: HTAB 1: GOTO 1080
1090 IF S1$ = "R" THEN RETURN
1100 IF LEFT$(S1$,1) = "0" THEN 1120
1110 IF VAL(S1$) = 0 THEN PRINT CHR$(13): VTAB ( PEEK(37) -2): CALL -958: GOTO 1080
1120 E = E +1:ST$(E) = ST1$
1130 B$(E) = B1$
1140 BN$(E) = BN1$
1150 BC$(E) = BC1$
1160 DB$(E) = DB1$
1170 DS$(E) = DS1$
1180 SC$(E) = SC1$
1190 SN$(E) = SN1$
1200 S$(E) = S1$
1210 EDIT = 1: REM FLAG FOR DISK WRITE
1220 RETURN
1230 POKE 35,23: VTAB 24: HTAB 1: PRINT " ------- <R> TO RETURN TO MENU -------";: HTAB 1: VTAB 4
1240 RETURN
1250 REM
1260 REM ***************
1270 REM * *
1280 REM * LIST STOCK *
1290 REM * *
1300 REM ***************
1310 REM
1320 GOSUB 6570: HOME :X$ = "LIST A STOCK DATA": INVERSE : GOSUB 4890: NORMAL
1330 POKE 34,2
1340 VTAB 23: POKE 35,22: HTAB 1: PRINT " ------ <RTN> TO RETURN TO MENU -------"
1350 VTAB 6
1360 PRINT : INPUT "ENTER STOCK NAME TO LIST ";ST1$
1370 IF ST1$ = "" THEN RETURN
1380 GOSUB 4600: IF HIT = 0 THEN RETURN : REM SEARCHFILE,IFNONE,BACKTOMENU
1390 HOME :X$ = ST$(I): INVERSE : GOSUB 4890: NORMAL : PRINT
1400 VTAB 3: FOR AA = 0 TO 39: PRINT "-";: NEXT AA
1410 PRINT TAB( 18)"BOUGHT"; TAB( 29)"SOLD": FOR AA = 0 TO 39: PRINT "-";: NEXT AA
3210 IF AA = J *16 THEN PRINT : VTAB 21: PRINT "TYPE 'P' TO PRINT LISTING": PRINT "ANY OTHER KEY TO CONTINUE ";: POKE -16368,0: GET Y$: PRINT : IF Y$ < >"P" THEN HOME
3220 IF Y$ = "P" THEN VTAB PEEK(37): HTAB 1: CALL -958: GOSUB 4990: HOME :Y$ = ""
3230 NEXT J
3240 NEXT K
3250 NEXT L
3260 PRINT
3270 GOSUB 1510: REM PRINT OR CONTINUE?
3280 TEXT : HOME : RETURN
3290 REM
3300 REM ***************
3310 REM * *
3320 REM * SEARCH BY *
3330 REM * YEARS *
3340 REM ***************
3350 REM
3360 GOSUB 6570: HOME : VTAB 3:X$ = "SEARCH STOCKS BY YEAR/NAME": INVERSE : GOSUB 4890: NORMAL
3370 VTAB 7: CALL -958: HTAB 1: PRINT "DO YOU WANT TO LIST STOCKS BY :"
3380 PRINT
3390 PRINT "1) YEAR OF PURCHASE"
3400 PRINT "2) YEAR OF SALE"
3410 PRINT "3) BOTH"
3420 PRINT "4) BY NAME"
3430 PRINT
3440 PRINT "5) RETURN TO MENU"
3450 VTAB 7: HTAB 34
3460 GET F$: PRINT F$:M2 = VAL(F$): IF M2 <1 OR M2 >5 THEN 3370
3470 ON M2 GOTO 3490,3690,3860,4040,3680
3480 GOTO 3380
3490 VTAB 6: CALL -958: PRINT : INPUT "ENTER THE YEAR YOU WISH TO LIST :19";BB$
3500 HOME : PRINT "STOCK NAME ";"BOUGHT SOLD PROFIT YIELD"
3510 PRINT TAB( 29)"(LOSS)"
3520 FOR J = 1 TO 40: PRINT "-";: NEXT J
3530 FOR I = 1 TO E
3540 IF RIGHT$(DB$(I),2) = RIGHT$(BB$,2) THEN WW = 1: GOSUB 4210
3550 IF WW < >1 THEN 3600
3560 IF RIGHT$(DS$(I),2) = "00" THEN PRINT LEFT$(ST$(I),15) TAB( 19) RIGHT$(DB$(I),2) TAB( 25)"--"; TAB( 31)"----" TAB( 36)"----": GOTO 3600
5710 PRINT : PRINT : PRINT "PRESS ANY KEY TO CONTINUE, 'P' TO PRINT";
5720 GET Y$: IF Y$ = "P" THEN GOSUB 4990
5730 GOTO 5330: REM BACK TO STATS MENU, PLEASE
5740 PRINT CHR$(0): REM CURRENT STOCKS UNSOLDD
5750 HOME :X$ = "STATISTICS OPTION 2": INVERSE : GOSUB 4890: NORMAL
5760 X$ = "STOCKS NOT YET SOLD": INVERSE : GOSUB 4890: NORMAL : PRINT : PRINT
5770 PRINT : PRINT "STOCK NAME DATE BOUGHT"
5780 K = 1: POKE 34,6: VTAB 8: HTAB 1
5790 FOR I = 1 TO E: IF RIGHT$(DS$(I),2) = "00" THEN PRINT K; CHR$(93);" ";ST$(I); TAB( 34) LEFT$(DB$(I),2);"/"; RIGHT$(DB$(I),2):K = K +1
5795 IF INT(I/15) = I/15 THEN PRINT : PRINT "TYPE 'P' TO PRINT LISTING": PRINT "ANY OTHER KEY TO CONTINUE";: POKE -16368,0: GET Y$: PRINT ;: IF Y$ < >"P" THEN HOME
5798 IF Y$ = "P" THEN VTAB PEEK(37): HTAB 1: CALL -958: GOSUB 4990: HOME :Y$ = ""
5800 NEXT I
5810 PRINT : PRINT
5820 PRINT "HIT 'P' TO PRINT--ANY OTHER TO CONTINUE";: GET F$
5830 IF F$ = "P" THEN GOSUB 4990
5840 TEXT : GOTO 5330: REM BACK TO STATS MENU, PLEASE
5850 PRINT CHR$(0): REM P/L BY YEARS
5860 HOME
5870 II = 1: REM INITIALIZE GRAPHICS ARRAY COUNTER --> II=1='1977"
6430 IF SGN(PL(I) -1) = -1 THEN COLOR= 11: REM PINKFOR'INTHERED'
6440 VLIN V,VH - ABS(PL(I)) AT 4 *I +1 -J
6450 COLOR= 2: REM DARK BLUE
6460 NEXT J
6470 NEXT I
6480 H = 2:V = 38: HLIN H,V +1 AT V
6490 VTAB 23
6500 PRINT "PRESS ANY KEY TO CONTINUE, 'P' TO PRINT.";: POKE -16368,0: GET Y$: IF Y$ = "P" THEN POKE 9,0: VTAB PEEK(37): CALL -958: GOSUB 5010: POKE 9,1
6510 Y$ = "": REM CLEAR Y$
6520 RETURN
6530 REM ERROR TRAP
6540 IF PEEK(222) = 5 THEN PRINT D$;"CLOSE": GOTO 7450
6550 TEXT : HOME : PRINT CHR$(7): PRINT "ERROR #"; PEEK(222);" IN LINE "; PEEK(218) + PEEK(219) *256
6560 PRINT : PRINT : PRINT "PRESS ANY KEY TO RETURN TO THE MENU.": GET G$: POKE -16368,0: GOTO 500
6570 IF E < >0 THEN RETURN
6580 CALL 65338: CALL 65338
6590 TEXT : HOME : VTAB 5:X$ = "THERE IS NO DATA IN THE FILE": GOSUB 4890: PRINT :X$ = "YOU MUST ADD A STOCK TO CREATE DATA": GOSUB 4890
6600 PRINT :X$ = "OR READ IN A DATA FILE WITH OPTION 3": GOSUB 4890
6610 POP : VTAB 20: HTAB 1:X$ = "PRESS ANY KEY TO CONTINUE ": GOSUB 4890: VTAB 20: HTAB 32: GET X$: POKE -16368,0: GOTO 500
6620 REM
6630 REM **************
6640 REM * *
6650 REM * CALCULATE *
6660 REM * MOST RECENT*
6670 REM * YEAR AND *
6680 REM * SCALE FAC. *
6690 REM * *
6700 REM **************
6710 REM
6720 EY = 0:LO = 0:HI = 0
6730 FOR I = 0 TO E
6740 IF VAL( RIGHT$(DS$(I),2)) >EY THEN EY = VAL( RIGHT$(DS$(I),2))
6750 NEXT I: IF EY < >0 THEN RETURN
6760 FOR I = 0 TO E: IF VAL( RIGHT$(DB$(I),2)) >EY THEN EY = VAL( RIGHT$(DB$(I),2))
6770 NEXT I
6780 RETURN
6790 DF = HI -LO:SC = INT(DF/38): FOR I = 1 TO 20: IF INT(SC/50) = I THEN 6820
6800 NEXT
6810 TIC = 50: RETURN
6820 TIC = (I +1) *50: RETURN
6830 TEXT : HOME :X$ = "DELETE A STOCK FROM THE FILE": INVERSE : GOSUB 4890: NORMAL
6840 X$ = "** <RTN> FOR EDIT/DELETE MENU **": VTAB 23: GOSUB 4890: POKE 35,22
6850 VTAB 6: INPUT "NAME OF STOCK TO DELETE--> ";ST1$
6860 IF ST1$ = "" THEN TEXT : GOTO 1690
6870 GOSUB 4600: REM SEARCH FOR NAME OF STOCK
6880 IF HIT = 0 THEN VTAB 4: CALL -958: VTAB 7:X$ = "NO SUCH STOCK IN FILE": VTAB 6: GOSUB 4890: VTAB 22: HTAB 1: PRINT "PRESS ANY KEY TO CONTINUE ";: GET X$: POKE -16368,0: HOME : GOTO 1690
6990 TEXT : HOME : VTAB 6: HTAB 13: FLASH : PRINT "DELETING RECORD": NORMAL
7000 FOR I = 1 TO 1000: NEXT : RETURN
7010 TEXT : HOME
7020 VTAB 3: FOR I = 1 TO 40: PRINT "*";: NEXT
7030 VTAB 6:X$ = "THE NIBBLE BROKER": INVERSE : GOSUB 4890: NORMAL : PRINT : PRINT : PRINT :X$ = "BY": GOSUB 4890: PRINT :X$ = "MARK R. CRAVEN": GOSUB 4890: PRINT : PRINT "** COPYRIGHT 1984 BY MICROSPARC, INC. **"
7040 PRINT : FOR I = 1 TO 40: PRINT "*";: NEXT : VTAB 22: PRINT "HIT ANY KEY TO CONTINUE ";: GET X$: PRINT : RETURN
7050 REM *************
7060 REM * *
7070 REM * SELL LESS *
7080 REM *THAN BOUGHT*
7090 REM * *
7100 REM *************
7110 HOME : PRINT "SELL LESS THAN AMOUNT BOUGHT?": PRINT : PRINT "IS THIS CORRECT? (Y/N) ";: GET Y$: POKE -16368,0: IF Y$ < >"Y" THEN PRINT CHR$(13): VTAB PEEK(37) -3: CALL -958: RETURN
7120 TEXT : HOME
7130 VTAB 6: PRINT "THIS REQUIRES THAT ANOTHER STOCK RECORD": PRINT "BE OPENED. PLEASE ENTER NEW STOCK NAME"
7140 PRINT "OR PRESS <RETURN> AND 'THE NIBBLE": PRINT "BROKER' WILL MAKE A NEW ONE FROM THE": PRINT "EXISTING ONE BY APPENDING A '*' TO": PRINT "THE OLD NAME.": PRINT
7150 PRINT "YOU MAY LATER RETURN TO EDIT THE NAME": PRINT "TO ANOTHER NAME IF YOU DESIRE"
7160 VTAB 15: HTAB 4: PRINT "NEW NAME (OR <RTN> ";: CALL -958: INPUT NS$
7170 IF NS$ = "" THEN NS$ = ST$(I) +"*": PRINT : PRINT
7180 FOR K = 1 TO E
7190 IF LEFT$(NS$, LEN(NS$)) = LEFT$(ST$(K), LEN(NS$)) THEN PRINT "DUPLICATE NAME--PLEASE RE-ENTER": FOR J = 1 TO 1000: NEXT J: GOTO 7160
7200 NEXT K: GOTO 7230
7210 REM
7220 REM
7230 VTAB 20: PRINT "NEW NAME IS ";: INVERSE : PRINT NS$: NORMAL